package com.qj.daibei.config;

import com.qj.daibei.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * author wml
 * Created on 2021/10/7 21:47
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/", "/jump2", "/login", "/zhuce", "/index", "/user/register", "/user/login", "/user/findtel", "/getvalidation")
                .excludePathPatterns("/favicon.ico", "/css/**", "/images/**", "/js/**");
    }
}
